package com.shens.blog.ui;

import java.awt.*;

import javax.swing.*;

import com.shens.blog.utils.CommUtils;

public class MJPanel extends JPanel {
    private static final long serialVersionUID = 1L;
    JOutputPanel outputPanel = null;
    JInputPanel inputPanel = null;

    public MJPanel() {
        this.setLayout(new BorderLayout());
        this.initContent();
    }

    private void initContent() {
        this.inputPanel = new JInputPanel();
        this.inputPanel.setBorder(BorderFactory.createEtchedBorder(0));
        this.outputPanel = new JOutputPanel();
        this.outputPanel.setBorder(BorderFactory.createEtchedBorder(0));
        this.outputPanel.setPreferredSize(new Dimension(this.getWidth(), 500));
        this.add(this.inputPanel, "North");
        this.add(this.outputPanel, "South");
        this.inputPanel.initView();
        this.outputPanel.initView();
    }

    public void appentOutPrint(String string) {
        this.outputPanel.appentOutPrint(string);
    }

    public void addListener() {
        CommUtils.addListener(this.inputPanel, this.outputPanel);
    }
}
